package cn.xueden.system.model.form;

import cn.xueden.common.group.UserGroup;
import com.alibaba.fastjson2.annotation.JSONField;

import jakarta.validation.constraints.NotBlank;
import lombok.Data;

import java.time.LocalDateTime;

/**功能描述：用户表单
 * @author:梁志杰
 * @date:2025/6/9
 * @description:cn.xueden.system.model.form
 * @version:1.0
 */
@Data
public class UserForm {

    /**
     * 主键ID
     */
    private Integer id;

    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     *  用户名
     */
    @NotBlank(groups = {UserGroup.CreateUserGroup.class, UserGroup.RegisterGroup.class}, message = "用户名不能为空")
    private String userName;
    /**
     * 密码
     */
    @NotBlank(groups = UserGroup.RegisterGroup.class,message = "密码不能为空")
    private String password;

    /**
     * 真实姓名
     */
    @NotBlank(groups = {UserGroup.CreateUserGroup.class, UserGroup.RegisterGroup.class}, message = "真实姓名不能为空")
    private String realName;

    /**
     * 角色ID
     */
    private Integer roleId;


    /**
     * 原密码
     */
    @NotBlank(groups = {UserGroup.UpdatePasswordGroup.class}, message = "原密码不能为空")
    private String originPassword;
    /**
     * 新密码
     */
    @NotBlank(groups = {UserGroup.UpdatePasswordGroup.class}, message = "新密码不能为空")
    private String newPassword;
    /**
     * 校验密码
     */
    @NotBlank(groups = {UserGroup.UpdatePasswordGroup.class, UserGroup.RegisterGroup.class}, message = "校验密码不能为空")
    private String checkedPassword;

    /**
     * 邮箱
     */
    @NotBlank(groups = {UserGroup.CreateUserGroup.class, UserGroup.RegisterGroup.class}, message = "邮箱不能为空")
    private String email;
}
